<template>
 <ex-dialog v-model="visible" draggable :title="form.resourceName"
  width="700" :contentHeight="450">
    <template #default>
      <el-tabs v-model="activeName"  style="height: 100%">
        <el-tab-pane label="基本信息23213" name="base" style="height: 100%">
          <el-descriptions class="margin-top" :column="2" border>
            <el-descriptions-item label="类型"><ex-label code="RESOURCE_TYPE" :value="form.resourceType"/></el-descriptions-item>
			      <el-descriptions-item label="上级资源"><ex-label code="SysResource" :value="form.parentLevelCode"/></el-descriptions-item>
            <el-descriptions-item :label="'编码'">{{form.resourceCode}}</el-descriptions-item>
            <el-descriptions-item :label="'名称'">{{form.resourceName}}</el-descriptions-item>
            <el-descriptions-item :label="'地址'">{{form.menuAddress}}</el-descriptions-item>
            <template v-if="form.resourceType==='0'">
              <el-descriptions-item label="菜单图标"><ex-label format code="ICON" :value="form.menuIcon"/></el-descriptions-item>
              <el-descriptions-item label="快捷中心图标" v-if="form.quickCenterIcon"><ex-label format code="ICON" :value="form.quickCenterIcon"/></el-descriptions-item>
              <el-descriptions-item label="菜单模式"><ex-label code="MENU_MODE" :value="form.menuMode"/></el-descriptions-item>
              <el-descriptions-item label="菜单路径">{{form.menuPath}}</el-descriptions-item>
              <el-descriptions-item label="附加参数">{{form.attachParams}}</el-descriptions-item>
            </template>
            <el-descriptions-item label="描述">{{form.description}}</el-descriptions-item>
            <el-descriptions-item label="创建时间"><ex-label format code="DATETIME" :value="form.createTime"/></el-descriptions-item>
            <el-descriptions-item label="创建人"><ex-label code="SysUser" :value="form.createUser"/></el-descriptions-item>
			      <el-descriptions-item label="是否可用"><ex-label code="IS_ENABLED" :value="form.isEnabled"/></el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane label="关联角色" name="SysRole" style="height: 100%">
          <ex-rel-table ref="roleRelTable" size="small" :rel-entity="form" :treeApi="this.$API.system.role.treeData" default-expand-all :selection="false"></ex-rel-table>
        </el-tab-pane>
      </el-tabs>
    </template>
  </ex-dialog>
</template>

<script>
import ExRelTable from "@/components/exRelTable/index.vue";
import ExLabel from "@/components/exLabel/index.vue";
import exDialog from '@/components/exDialog';

export default {
  computed: {
  },
  emits: ['success'],
  components: {
	  ExLabel,
    ExRelTable,
    exDialog
  },
  props: {
  },
  data() {
    return {
      activeName: 'base',
      visible: false,
      icon: "approved",
      form: {},

    }
  },
  methods: {
    //显示
    open(entity) {
      this.form = Object.assign({}, entity);
      this.visible = true;
      this.activeName = "base";
    },
  }
}
</script>

<style scoped>
h2 {
  font-size: 17px;
  color: #3c4a54;
  padding: 0 0 30px 0;
}

[data-theme="dark"] h2 {
  color: #fff;
}

</style>
